package poj3126;

import java.util.Arrays;
import java.util.Scanner;

public class Bate1
{
	private static Scanner sc = new Scanner(System.in);
	
	public static void main(String[] args)
	{
		int s = sc.nextInt();
		int e = sc.nextInt();
		
		boolean[] nums = new boolean[e/2+1];
		Arrays.fill(nums, true);
		
		int t = (int) Math.sqrt(e);
		for(int i=3; i<=t; i+=2)
		{
			if(nums[(i-1)>>1])
			{
				int step = i << 1;
				
				for(int j = i + step; j<=e; j += step)
				{
					nums[(j-1)>>1] = false;
				}
			}
		}
		
		for(int i=(s-1)>>1; i<nums.length; i++)
		{
			if(nums[i])
			{
				System.out.println((i<<1)+1);
			}
		}
	}

}
